﻿using System;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace Spacer {
    public class FighterLarge : Ship {
		public FighterLarge() {}

        public FighterLarge( SolarSys world ) : base(world) {
			if( this.GetType() == typeof(FighterLarge) ) Initialize();
        }

		public override void Initialize() {
			base.Initialize();

			DrawMode = DrawMode.Sprite;
            Sprite = Main.Sprites["FighterLarge"];
            DrawScale = DrawScale * .3f;
            DrawColor = new Color( 1f, 1f, 1f, 1f );

            PhysicsInit( 1f, MovementMode.Normal );
            Friction = 0.3f;
            AngularDamping = 3f;
            LinearDamping = 1f;

			Health = 1500f;
			MaxHealth = 1500f;

			FireRate = 0.3f;
            ProjectileType = typeof( Projectile );

			MissileFireRate = 3f;
            MissileProjectileType = typeof( Missile );

            Fuel = 1000000;
            MaxFuel = 1000000;
			MovementForce = 18f;
			TurningForce = 5f;
			BoostMultiplier = 3f;

            Resources = 10000;
		}

        // ----------

		public override void DoFire() {
			if( Globals.GameTime - LastFireTime >= FireRate ) {
				FireProjectile( ProjectileType, GetShootPos(new Vector2(0, -1.4f)) );
				FireProjectile( ProjectileType, GetShootPos(new Vector2(0, 1.4f)) );
				LastFireTime = Globals.GameTime;
			}

			if( Globals.GameTime - LastMissileFireTime >= MissileFireRate ) {
				FireProjectile( MissileProjectileType, GetShootPos() );
                LastMissileFireTime = Globals.GameTime;
            }
		}

        // ----------

		public float MissileFireRate { get; set; }
        public float LastMissileFireTime { get; set; }
        public Type MissileProjectileType { get; set; }
    }
}
